home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
varia
/
egebook.lha
/
ege.book
/
1
/
hello2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-04
|
474b
|
26 lines
#include <stdio.h>
struct HelloWorld {
char *message;
};
void announce(struct HelloWorld& hw){
printf("%s \n", hw.message);
}
void change(struct HelloWorld& hw, char *newmessage){
hw.message = newmessage;
}
main(){
struct HelloWorld hw1, hw2;
change(hw1, "hello world");
change(hw2, "hello world");
announce(hw1);
announce(hw2);
change(hw1, "this is hw1");
change(hw2, "different object");
announce(hw1);
announce(hw2);
}